Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[Numpy] Numpy compatible slicing #15798

Merged
merged 5 commits into from
Aug 10, 2019
Merged

Conversation

mikemwx
Copy link
Contributor

@mikemwx mikemwx commented Aug 8, 2019

Description

Add numpy compatible slicing operator under npx namespace

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • generally similar behavior as ndarray.slice
  • like numpy slicing, we allow the starting index to be greater than ending index, in which case a zero size tensor is generated

Comments

Thank @haojin2 and @reminisce for reviewing

@reminisce reminisce added the Numpy label Aug 8, 2019
@mikemwx mikemwx force-pushed the npx-slice-to-master branch 2 times, most recently from 8b9fc9a to 18792d5 Compare August 9, 2019 07:37
@haojin2 haojin2 self-requested a review August 10, 2019 03:56
Copy link
Contributor

@haojin2 haojin2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@haojin2 haojin2 merged commit 44a7fca into apache:master Aug 10, 2019
anirudhacharya pushed a commit to anirudhacharya/mxnet that referenced this pull request Aug 20, 2019
* Modify ndarray slice to have numpy compatbile behaviou

* Minor syntax fix

* Fix slice inconsistency

* Allow empty outputs after slicing ndarrays

* Fix
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* Modify ndarray slice to have numpy compatbile behaviou

* Minor syntax fix

* Fix slice inconsistency

* Allow empty outputs after slicing ndarrays

* Fix
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* Modify ndarray slice to have numpy compatbile behaviou

* Minor syntax fix

* Fix slice inconsistency

* Allow empty outputs after slicing ndarrays

* Fix
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request Sep 25, 2019
* Modify ndarray slice to have numpy compatbile behaviou

* Minor syntax fix

* Fix slice inconsistency

* Allow empty outputs after slicing ndarrays

* Fix
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants